<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib uri="/WEB-INF/tlds/hdiv-spring.tld" prefix="spring"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<c:url value="mostrarHWF1005.html" var="equivalenciadeclientes"/>
  
  <script type="text/javascript">
      
        function show_loading(){  
            var loadingAnim = document.getElementById('loading_mostrar');  
            loadingAnim.innerHTML = '<img src="imagenes/logoProcesandoDown.gif" width=' + xx_d + 'height=' + yy_d + 'alt="Procesando" />';  
            loadingAnim.style.display = 'block';      
            }  
      
        function habilitaDeshabilitaChk()
            {   estadoTotal=false;                  
                $("#modificar").removeAttr("disabled");
                //document.forms[0].action[2].disabled=false; 
            } 
            
        function buscarDestino(){            
                document.forms[0].accion.value='buscar'; 
                document.forms[0].submit();            
        }                  
        function chekarKey(evt){
        evt = (evt) ? evt : event;
        var charCode = (evt.charCode) ? evt.charCode :((evt.which) ? evt.which : evt.keyCode);
        alert('key: '+charCode);
        return charCode;
}
        
        function seleccionar(codDest,desDest,codEqui,desEqui,estado){
            estadoTotal=false;    
            //alert('datos:'+codDest+'-'+desDest+'-'+codEqui+'-'+desEqui+'-'+estado)
            $("#modificar").removeAttr("disabled");
            //document.forms[0].action[2].disabled=false; 
            //document.forms[0].codDestinoSelecc.value = codDest;
            //document.forms[0].desDestinoSelecc.value = desDest;
            //document.forms[0].codEqui.value = codEqui;
            //document.forms[0].desEqui.value = desEqui;
            //document.forms[0].estado.value = estado;
            
            //Made by JCR
        }          
        
        function cursor_wait() {
        document.body.style.cursor = 'wait';
        }
        
        function mostrar(){
                //activar el div procesando con javascript
                show_loading();
                setTimeout('show_loading();', 1000);
                cursor_wait() ;
                //////
                moveForward('mostrar');      
        }  

        function nueva(){
            if (document.forms[0].desDestino.value == "" || 
                document.forms[0].codDestino.value == "") {
                alert("Por favor realice la busqueda de Cliente Destino");        
            }else{
                moveForward('nueva');           
            }                 
        }  
        
        function modificar(){ 
                moveForward('modifica');          
        }  
        
  </script>
  
<style type="text/css">  
<!-- 
#loading_mostrar {display:none;}  
-->  
</style> 
  
<form:form modelAttribute="form" action="${equivalenciadeclientes}">
<form:hidden path="accion"/>
<form:hidden path = "control"/>
<form:hidden path="cliente"/>
<form:hidden path = "sucursal"/>
<form:hidden path = "habilitarEstado"/>
<form:hidden path = "codEqui"/>
<form:hidden path = "desEqui"/>
<form:hidden path = "desDestinoSelecc"/>
<form:hidden path = "codDestinoSelecc"/>

<table id="fullheighttable" width="775" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="left" valign="top" class="fondo_contenido padtop16left21">
      <table border="0" cellspacing="0" cellpadding="0" class="verdana11bazul">
      <tr>
        <td height="22" align="left" valign="top" class="verdana11bazul">
		<ul class="navlist2">
		<li>
                              <spring:message code="HMF1005.titulo"/>
                            </li>
		</ul></td>
        </tr>
      <tr>
        <td align="left" valign="top" class="borde_totalblanco"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="105" height="23" align="left" valign="top" class="verdana10bazul"> 
                 <spring:message code="HMF1005.cliente.titulo"/>
            </td>
            <td height="23" align="left" valign="top" class="verdana10negro">
                <c:out value="${sessionScope.nombreCliente}"/>
               </td>
          </tr>          
           <tr>
              <td width="110" height="34" align="left" valign="bottom" class="verdana10bazul" >
                    <spring:message code="HMF1005.cliente.destino.titulo"/>
              </td>
              <td width="283" height="34" align="left" valign="bottom" >
                <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" valign="bottom" class="padright10">
                      <div class="fondo_txtbox257">                    
                      <form:input path="desDestino" maxlength="45" size="42"  onkeydown="return blockEnter(event)" onkeyup="javascript:var y=verificaDireccional(event);if(y=='true'){this.value=value.toUpperCase();}" />
                      <form:hidden path="codDestino"/>                      
                      </div>
                  </td>
                  <td class="padright10">                 
                      <input name="Submit2" type="button" class="boton" value="Buscar Destino" onclick="buscarDestino();">                         
                  </td>
                </tr>
                </table>
              </td>
          </tr>                    
        </table>
        </td>
      </tr>
      </table>
        <table>
            <tr>
             <td>
                <input type="button" class="boton" value="Mostrar" onclick="javascript:mostrar()"/>
             </td>            
             <td>
                <input type="button" class="boton" value="Nueva" onclick="javascript:nueva()"/>              
             </td>            
             <td>
                <input type="button" class="boton" value="Modificar" id="modificar" onclick="moveForward('modifica');" disabled="true"/>    
             </td>
            </tr>
            
            <tr>
                <td colspan="8" align="center">    
                <div id="loading_mostrar"><img id="logoDown" src="imagenes/logoProcesandoDown.gif" alt="Procesando" /></div>  
                </td>
           </tr>
            
        </table>

        <c:if test="${not empty listadoDestino}">
              <table border="0" cellpadding="0" cellspacing="0" class="margintop20" >
                <tr >
                  <td width="100%">
                      <display:table id="lista" name="listadoDestino" cellpadding="0"
                                     cellspacing="0" style="width:90%" pagesize="10"
                                     requestURI="${equivalenciadeclientes}"
                                     class="its">
                       <tbody>
                        <display:column headerClass="columnheader_first"
                                        class="columnbody_first" title="Sel.">
                        <form:radiobutton path="chk" value="${lista.codPunto}-${lista.desPunto}*${lista.codEquiAgen}!${lista.desEquiAgen}+${lista.codCliente}" onclick="javascript:seleccionar('${lista.codPunto}','${lista.desPunto}','${lista.codEquiAgen}','${lista.desEquiAgen}','${lista.codCliente}')"/>
                        </display:column>
                        <display:column property="codPunto"
                                        headerClass="even" class="cellderecha "
                                        title="C&oacute;digo"/>
                        <display:column property="desPunto"
                                        headerClass="even" class="even "
                                        title="Descripci&oacute;n"/>
                        <display:column property="codEquiAgen"
                                        headerClass="even" class="cellderecha "
                                        title="C&oacute;d. Equiv."/>                
                        <display:column property="desEquiAgen"
                                        headerClass="even" class="even "
                                        title="Descripci&oacute;n Equiv."/>
                        <display:column property="codCliente"
                                        headerClass="even" class="even "
                                        title="Activo"/>                                        
                       </tbody>
                      </display:table>
                  </td>
                </tr>
                <tr><td>&nbsp;</td>
                </tr>
              </table>
        </c:if>
        
        <table border="0">
            <tr>
                 <td class="padtop12 padleft20" height="23" valign="top" align="center">
                    <form:errors path="*" cssClass="error"/>
                 </td>
            </tr>
        </table>          
        
    </td>
  </tr>
</table>
<tr>
</form:form> 
